import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;

public class A{
    boolean bool=true;
    Scanner scanner=new Scanner(System.in);
    String chance;
    double money=0;
    double balance=0;
    String que;
    String note;
    Date date=null;
    SimpleDateFormat simpleDateFormat=new SimpleDateFormat("YYYY--MM-DD hh:mm");
    String details="=====零钱通明细=========";
    public void detail(){
        System.out.println(details);
    }
    public void income(){
        System.out.println("收益金额");
        money=scanner.nextDouble();
        if(money<=0){
            System.out.println("收益异常");
            return;
        }
        balance+=money;
        date=new Date();
        details+="\n收益入账"+money+"\t"+simpleDateFormat.format(date)+"\t"+balance;
    }
    public void pay(){
        System.out.println("消费金额");
        money=scanner.nextDouble();
        if(money>balance){
            System.out.println("余额不足");
            return;
        }
        balance-=money;
        System.out.println("消费说明");
        note=scanner.next();
        details+="\n"+note+"-"+money+"\t"+simpleDateFormat.format(date)+"\t"+balance;
    }
    public boolean exit(){
        System.out.println("你确定退出吗？\ny:确定 n:不确定");
        que=scanner.next();
        if(que.equals("y")) {
            bool = false;
            return bool;
        }
        return bool;
    }
    
}
